home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
stpfcb12.zip
/
STOPFCBS.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-05-27
|
5KB
|
131 lines
' STOPFCBS is Copyright 1991 by Alex Boge
' Version 1.00 May 9, 1991
' Version 1.01 May 10, 1991 - Remove Deinstall functions, remove help,
' check to see if SHARE was loaded before installing, trap more functions and
' compile for 286 or better only.
' Version 1.10 May 23, 1991 - YIPES, big boo-boo. Program was developed
' and tested under 4DOS instead of COMMAND.COM, so I didn't "know" that
' COMMAND.COM uses FCB functions 13H & 17H. Had to drop these!
' Version 1.20 May 27, 1991 - STOPFCBS now uses Int 2Fh to return true for
' installed state of SHARE. This prevents multiple installs of STOPFCBS
' and also prevents SHARE from being loaded afterwards.
' This program stops INT 21H FCB-Oriented Functions 0FH and 16H
' from causing harm to BIGDOS partitions.
' Linked with BASIC PDS v7.10 and P.D.Q. 2.18 as follows:
' BC /O /G2 STOPFCBS;
' LINK /NOD /NOE STOPFCBS STR00256 _NOERROR _NOREAD _NOVAL,,NUL,BASIC7 PDQ;
DEFINT A-Z
TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
Flags AS INTEGER
DS AS INTEGER
ES AS INTEGER
SS AS INTEGER
SP AS INTEGER
BusyFlag AS INTEGER
Address AS INTEGER
Segment AS INTEGER
ProcAdr AS INTEGER
ProcSeg AS INTEGER
IntNum AS INTEGER
END TYPE
DIM Registers21 AS RegType
DIM Registers2F AS RegType
DECLARE SUB EndTSR (ID$)
DECLARE SUB GotoOldInt (Registers AS RegType)
DECLARE SUB IntEntry1 ()
DECLARE SUB IntEntry2 (Registers AS RegType, Action%)
DECLARE SUB Interrupt (IntNumber, Registers AS ANY)
DECLARE SUB Pause (Ticks%)
DECLARE SUB PDQPrint (Work$, Row%, Column%, Colr%)
DECLARE SUB PointIntHere (Registers AS RegType)
DECLARE SUB ReturnFromInt (Registers AS RegType)
ID$ = "STOPFCBS Version 1.20"
PRINT ID$ + " (C) 1991 by Alex Boge."
Registers2F.AX = &H1000 ' AH=&h10, AL=&h00 - Function to test for SHARE
Interrupt &H2F, Registers2F ' So we get it! (returned in AL)
IF (Registers2F.AX AND &HFF) = &HFF THEN
PRINT "SHARE or STOPFCBS has already been installed.": END
END IF
PRINT "STOPFCBS installed - Intercepting INT 21h functions 0Fh and 16h."
IF INSTR(UCASE$(COMMAND$), "/Q") THEN
Verbose = 0
PRINT "Message line will be suppressed - beep will sound during an intercept."
ELSE
Verbose = -1
Message$ = "« STOPFCBS has intercepted INT 21h FCB-Oriented function "
END IF
Registers21.IntNum = &H21 'specify trapping Int 21h
PointIntHere Registers21 'load Registers with what it needs, and pass
GOTO Multiplex ' control to the next line at each Int. 21h
'----- the code below receives control with each Interrupt 21h
IntEntry1 'this is the first mandatory step
IntEntry2 Registers21, 0 'and this is the second one
Service = Registers21.AX \ 256 'get the current service number in AH
'open, delete, create & rename file using FCB
IF Service = &HF OR Service = &H16 THEN
BEEP 'make noise
IF Verbose THEN 'if we are allowed
DEF SEG = 0: V = PEEK(&H449): DEF SEG 'get video mode
IF V < 4 OR V = 7 THEN PDQPrint Message$ + HEX$(Service) + "h »", 1, 1, 15 'only in text mode
Pause 36 'pause about 2 seconds
END IF
Registers21.AX = Service * 256 + &HFF 'return fail code
ReturnFromInt Registers21 'finished
ELSE
GotoOldInt Registers21 'on to original Int 21h if we're not trapping
END IF
'--- END Int 21h
Multiplex:
Registers2F.IntNum = &H2F 'specify trapping Int 21h
PointIntHere Registers2F 'load Registers with what it needs, and pass
GOTO GoRes ' control to the next line at each Int. 2Fh
'----- the code below receives control with each Interrupt 2Fh
IntEntry1 'this is the first mandatory step
IntEntry2 Registers2F, 0 'and this is the second one
Proc = Registers2F.AX \ 256
Func = Registers2F.AX AND 255
'get installed state of SHARE:
' According to Programmers PC Source Book, Func=0, but real life shows
' that AL is &H80 so let's check for both to be safe
IF Proc = &H10 AND (Func = 0 OR Func = &H80) THEN
Registers2F.AX = &H10FF 'indicate installed state
ReturnFromInt Registers2F 'finished
ELSE
GotoOldInt Registers2F 'on to original Int 2Fh if we're not trapping
END IF
'----- END Int 2Fh
GoRes:
EndTSR ID$ 'terminate and stay resident